<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Route;

class BusinessTime extends BaseModel
{
	public function getStartAttribute($value)
	{
		if (Route::currentRouteName() === 'businesstime.edit') {
			if ($value >= 86400 - 8*3600){
				return '次日'.date('H:i:s',$value);
			}
				return date('H:i:s',$value);
		}
		return $value;
	}
	
	public function getEndAttribute($value)
	{
		if (Route::currentRouteName() === 'businesstime.edit') {
			if ($value >= 86400 - 8*3600){
				return '次日'.date('H:i:s',$value);
			}
				return date('H:i:s',$value);
		}
		return $value;
	}
}
